<% title _("Users") %>

<% title_actions new_link(_("Create User")) %>

<table class="<%= table_css_classes 'table-fixed' %>">
  <thead>
    <tr>
      <th><%= sort :login, :as => s_("User|Login") %></th>
      <th><%= sort :firstname, :as => s_("User|Firstname")%></th>
      <th><%= sort :lastname, :as => s_("User|Lastname") %></th>
      <th><%= sort :mail, :as => s_("User|Mail") %></th>
      <th><%= sort :admin, :as => s_("User|Admin") %></th>
      <th><%= sort :last_login_on, :as => s_("User|Last login on"), :default => 'DESC' %></th>
      <th><%= _("Authorized by") %></th>
      <th class="col-md-1"><%= _('Actions') %></th>
    </tr>
  </thead>
  <tbody>
    <% @users.each do |user| %>
      <tr>
        <td class="ellipsis"><%= avatar_image_tag user, :class => "avatar" %> <%=link_to_if_authorized user.login, hash_for_edit_user_path(:id => user).merge(:auth_object => user, :authorizer => authorizer) %></td>
        <td class="ellipsis"><%= user.firstname %></td>
        <td class="ellipsis"><%= user.lastname %></td>
        <td class="ellipsis"><%= user.mail %></td>
        <td><%= checked_icon user.admin? %></td>
        <td class="ellipsis"><%= last_login_on_column(user)%></td>
        <td class="ellipsis"><%= auth_source_column(user) %></td>
        <td><%= user_action_buttons(user) %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= will_paginate_with_info @users %>
